package com.jiniutech.enterprise.controller;

import com.jiniutech.common.result.ResultWrap;
import com.jiniutech.enterprise.component.EnterpriseConfig;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 通讯录controller
 */
@RestController
@RequestMapping(value = "/communication")
@Slf4j
public class CommunicationController extends ParentController{

    @Resource
    private EnterpriseConfig config;

    /**
     * 通讯录回调
     * @return
     */
    @GetMapping("/sync")
    @ResultWrap(wrap = false)
    public String CommunicationSync(@RequestParam(name = "msg_signature") String msgSignature,
                                    @RequestParam Integer timestamp,
                                    @RequestParam String nonce,
                                    @RequestParam(name = "echostr") String echoStr){
        return super.getCheckResult(msgSignature,timestamp,nonce,echoStr,config);
    }


}
